package com.baidu.customview.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import java.util.ArrayList;

/**
 * Created by Kvin on 2016/1/7.
 */
public class VGAdapter extends MBaseAdapter<Integer> {
    public VGAdapter(final ArrayList<Integer> list, final Context context) {
        super(list, context, new BaseAdapterCallback() {
            @Override
            public View getView(int position, View convertView, ViewGroup parent, LayoutInflater inflater) {
                ImageView iv;
                if (convertView == null) {
                    iv = new ImageView(context);
                } else {
                    iv = (ImageView) convertView;
                }
                iv.setImageResource(list.get(position));
                return iv;
            }
        });
    }
}
